package 基本数据类型;

import java.util.Arrays;
import org.testng.Assert;
import org.testng.annotations.Test;

/**
 * @author topjoy
 */
public class TheByte {

    /**
     * byte类型以数字赋值，
     *
     */
    @Test
    private void t1() {
        byte b1 = 0;
        byte b2 = 127;
        byte b3 = -128;

        // 范围 -128 ~ 127
//        byte b4 = 128;

        int i1 = b3;

        int i = Byte.toUnsignedInt(b3);

        String s = Integer.toBinaryString(i1);
        System.out.println(s);

        Assert.assertEquals(b3, -128);
        System.out.println();

    }

    @Test
    private void t2() {
        Byte b1 = 127;
//        Byte b2 = 128;

    }

}
